home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 476-500 / disk_493 / bbformat / lib / inhibit.c < prev    next >
C/C++ Source or Header  |  1992-05-06  |  1KB  |  59 lines

  1. /* DiskMisc.c - miscellaneous disk support routines.
  2.  * Mark Rinfret (et al), 1987
  3.  */
  4.  
  5. /*#define DEBUG*/
  6.  
  7. #define __NO_PRAGMAS /* DAV */
  8.  
  9. #include <exec/types.h>
  10. #include <exec/memory.h>
  11. #include <exec/ports.h>
  12. #include <exec/io.h>
  13. #include <libraries/dosextens.h>
  14. #include <functions.h>
  15.  
  16. extern LONG     sendpkt();
  17.  
  18.  
  19. /* Disk ACTION_INHIBIT support routine.
  20.  * Author:        Mark R. Rinfret
  21.  * Date:        06/29/87
  22.  * 
  23.  * This routine provides support for user-written disk formatting, copy
  24.  * operations which benefit from suppressing/restoring disk validation.
  25.  */
  26.  
  27. int
  28. MyInhibit(drivename, code)
  29.     char *drivename; int code;
  30. {
  31.     struct MsgPort     *task;
  32.     LONG     arg[2];
  33.  
  34.     if (!(task=(struct MsgPort *) DeviceProc(drivename))) 
  35.         return 1;            /* fail, darn it! */
  36.  
  37.     arg[0] = code;
  38.  
  39.     /* Now, cross all your fingers and toes... */
  40.  
  41.     return ( !sendpkt(task,ACTION_INHIBIT,arg,1L));
  42. }
  43.  
  44. #ifdef DEBUG
  45. main(argc,argv)
  46. int argc;
  47. char *argv[];
  48. {
  49.     int status;
  50.  
  51.     if(argc >1)
  52.         status = Inhibit("df1:",1);
  53.     else
  54.         status = Inhibit("df1:",0);
  55.  
  56.     printf("Status %d\n",status);
  57. }
  58. #endif
  59.